package com.gs.spring.core.simple;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;

import com.gs.spring.core.SimpleBean;

@Component
public class SuperSimpleBeanBeanFactoryPostProcessor implements BeanFactoryPostProcessor{

	public void postProcessBeanFactory(
			ConfigurableListableBeanFactory beanFactory) throws BeansException {
		BeanDefinition beanDefinition = beanFactory.getBeanDefinition("superSimpleBean");
		System.out.println(beanDefinition);
//		System.out.println("Changing the scope of bean from default to " + BeanDefinition.SCOPE_PROTOTYPE);
//		beanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE);
		System.out.println("Can change bean definition here.. for beanDefinition:  " + beanDefinition );
	}
	
}
